<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //数组去重
    var array = prompt('输入需要去除重复数字的数组')
    var arr2 = array.split('，')
    console.log(arr2)
    var res = []
    for (var k = 0;k<array.length;k++){
        if (res.indexOf(array[k])===-1){
            res.push(array[k])
        }
    }
    document.write('去重前 '+array)
    document.write('<br />')
    document.write('去重后 '+res)
</script>
</body>
</html>